﻿<%@ page language="java" pageEncoding="UTF-8"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>湖北省地质灾害应急响应系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Language" content="zh-CN" />
		<link href="style/style-login.css" rel="stylesheet" type="text/css" />
		<script src="lib/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="lib/json2.js" type="text/javascript"></script>
		
		<script type="text/javascript">
		function userLogin(){
			var url = "managerUser.shtml";
			var data ={
				"username":$("#username").val(),
				"password":$("#password").val()
			}
			$.post(url,data,cbUserLogin)
		}
		function cbUserLogin(response){
			//eval('('+str+')')
			//var str = '{"eMail":"邮箱4","password":"密码31","userName":"用户2"}';
			//var res = eval('('+response.jsonResult+')')
			var res = response.jsonResult;
			if(res=="1"){
				window.location = "index.jsp";
			}else if(res=="2"){
				alert("用户名密码错误");
			}else if(res=="3"){
				alert("当前用户在线，不允许重复登录");
			}else{
				alert("服务器端出现错误，请联系管理员");
			}
			
		}
		</script>
	</head>
	<body>
	<jsp:useBean id="username" class="java.lang.String" scope="request"/> 
      <div id="container">
			<div id="content">
			<form >
				<div id="login">
					<ul>
						<li>
							用户名：
							<input id="username" name="username" type="text" class="input" value="admin"/>
						</li>
						<li>
							密&nbsp;&nbsp;码：
							<input id="password" name="password" type="password"
								class="input" value="admin" />
						</li>
					</ul>
				</div>

				<div id="enter">
					<a href="#"><input type="button" class="submit" value="" onclick="userLogin()" title="点击登录"/></a>
				</div>
				<div id="resetdiv" >
	<a href="#"><input type="button" class="resetdiv" value="" onclick="document.getElementById('username').value='';document.getElementById('password').value='';"  title="点击重置"/></a>
				
				</div>
				</form>
			</div>
		</div>
		<script type="text/javascript">
		$(document).ready(function(){
			$("#username").focus(function(){$(this).css("border-color","#76A80B").css("background-color","#FFFFAC")})
			.blur(function(){$(this).css("border-color","#A1A7B5").css("background-color","#FFFFFF")});
			$("#password").focus(function(){$(this).css("border-color","#76A80B").css("background-color","#FFFFAC")})
			.blur(function(){$(this).css("border-color","#A1A7B5").css("background-color","#FFFFFF")});
		
		})
		</script>	
	</body>
</html>
